home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / complib / cscal1d.z / cscal1d
Encoding:
Text File  |  1998-10-30  |  6.0 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ccccssssccccaaaallll1111dddd,,,,zzzzssssccccaaaallll1111dddd((((3333FFFF))))                                        ccccssssccccaaaallll1111dddd,,,,zzzzssssccccaaaallll1111dddd((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ccccssssccccaaaallll1111dddd,,,, zzzzssssccccaaaallll1111dddd ---- scales a 1D real sequence.
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  12.      _F_o_r_t_r_a_n :
  13.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ccccssssccccaaaallll1111dddd(((( nnnn,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, iiiinnnncccc))))
  14.           iiiinnnntttteeeeggggeeeerrrr            nnnn,,,, iiiinnnncccc
  15.           rrrreeeeaaaallll               aaaallllpppphhhhaaaa
  16.           ccccoooommmmpppplllleeeexxxx            aaaarrrrrrrraaaayyyy((((0000::::((((nnnn----1111))))****iiiinnnncccc))))
  17.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee zzzzssssccccaaaallll1111dddd(((( nnnn,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, iiiinnnncccc))))
  18.           iiiinnnntttteeeeggggeeeerrrr            nnnn,,,, iiiinnnncccc
  19.           rrrreeeeaaaallll****8888             aaaallllpppphhhhaaaa
  20.           ccccoooommmmpppplllleeeexxxx****11116666         aaaarrrrrrrraaaayyyy((((0000::::((((nnnn----1111))))****iiiinnnncccc))))
  21.  
  22.      _C :
  23.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  24.      iiiinnnntttt ccccssssccccaaaallll1111dddd (((( iiiinnnntttt nnnn,,,, ffffllllooooaaaatttt aaaallllpppphhhhaaaa,,,, ccccoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,, iiiinnnntttt iiiinnnncccc))));;;;
  25.      iiiinnnntttt zzzzssssccccaaaallll1111dddd (((( iiiinnnntttt nnnn,,,, ddddoooouuuubbbblllleeee aaaallllpppphhhhaaaa,,,, zzzzoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,, iiiinnnntttt iiiinnnncccc))));;;;
  26.  
  27.  
  28. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  29.      ccccssssccccaaaallll1111dddd and zzzzssssccccaaaallll1111dddd scale a complex sequences of N samples.
  30.      The Fourier Transforms are not normalized so the succession Direct-
  31.      Inverse transform scales the input data by a factor equal to the size of
  32.      the transform.  ccccssssccccaaaallll1111dddd or zzzzssssccccaaaallll1111dddd are used to scale back the result.
  33.  
  34. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  35.      NNNN Integer, the number of samples in each sequence.
  36.      Unchanged on exit.
  37.  
  38.      AAAAllllpppphhhhaaaa scaling floating point value.
  39.  
  40.      AAAARRRRRRRRAAAAYYYY Array containing the samples of the sequence to be scaled (in
  41.      place0.
  42.  
  43.      IIIINNNNCCCC Integer, increment between two consecutive elements of a sequence.
  44.           Unchanged on exit.
  45.  
  46.      PPPP Integer, the number of sequences.       Unchanged on exit.
  47.  
  48.  
  49. EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
  50.      Given a 1D Complex sequence of 200 samples.  We successively apply a
  51.      Direct Fourier Transform, an Inverse Fourier Trasnform and finally scale
  52.      back the result by a factor 1/N (1/200.)-
  53.      This sequence DirectFFT-InverseFFT-Scaling is equivalent to the identity
  54.      operator and the final sequence should be equal (with round-off
  55.      precision) to the initial sequence.
  56.      Elements of each sequence are stored with increment (stride) 1.
  57.      FFFFoooorrrrttttrrrraaaannnn ::::
  58.           complex array(0:200-1), coeff(200+15)
  59.           call cfft1di( 200, coeff)
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ccccssssccccaaaallll1111dddd,,,,zzzzssssccccaaaallll1111dddd((((3333FFFF))))                                        ccccssssccccaaaallll1111dddd,,,,zzzzssssccccaaaallll1111dddd((((3333FFFF))))
  71.  
  72.  
  73.  
  74.          call cfft1d( -1, 200, array, 1, coeff)
  75.           call cfft1d(  1, 200, array, 1, coeff)
  76.           call cscal1d(200,(1./real(200)),array,1)
  77.  
  78.      CCCC ::::
  79.           #include <fft.h>
  80.           complex array[200], *coeff;
  81.           coeff = cfft1di( 200, NULL);
  82.           cfft1d( -1, 200, array, 1, coeff);
  83.           cfft1d(  1, 200, array, 1, coeff);
  84.           cscal1d( 200, 1./(float)200, array, 1);
  85.  
  86.      NNNNOOOOTTTTEEEE____1111 :::: The Direct and Inverse transforms should use opposite signs -
  87.      Which one is used (+1 or -1) for Direct transform is just a matter of
  88.      convention-
  89.  
  90.      NNNNOOOOTTTTEEEE____2222 :::: The Fourier Transforms are not normalized so the succession
  91.      Direct-Inverse transform scales the input data by a factor equal to the
  92.      size of the transform.
  93.  
  94. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  95.      fft, cfft1di, zfft1di, cfft1d, zfft1d, sprod1d, dprod1d
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.